<?php if($type == 'textarea') { ?>
<?php if ($error != ''): ?>
    <ul class="message error">
        <?php if ($error != ''): ?>
            <li><?php echo $error ?></li>
        <?php endif; ?>
    </ul>
<?php endif; ?>
<?php if($success != ''): ?>
<ul class="message success">
    <li><?php echo $success; ?></li>
</ul>
<?php endif; ?>
<form class="form has-validation" method="POST" action="">
    <input type="hidden" name="frmToken" id="frmToken" value="<?php echo $frmToken ?>"/>

    <div class="clearfix">
        <div class="clearfix"></div>
        <textarea rows="10" cols="35" name="content" class="content" id="content"><?php echo (set_value('content') != '') ?  set_value('content') : $postInfo['content'] ?></textarea>
        <input type="ckeditor" class="tmpContent" name="tmpContent" id="tmpContent" style="width:1px;height:1px;outline:none;border:none;background:none"/>
    </div>

    <div class="form-action clearfix">
        <input class="button" type="submit" name="submit" data-icon-primary="ui-icon-circle-check" value="OK"/>
        <input class="button" type="reset" value="Nhập lại"/>
    </div>
</form>

<script type="text/javascript">
    $(document).ready(function() {
        $(".content").ckeditor();
        $.tools.validator.fn("[type=ckeditor]", "Không được để trống !", function (input, value) {
            var summary = CKEDITOR.instances.content.getData();
            if(summary == '' || summary.length < 30)
                return false;
            return true;
        });
    });
</script>
<?php }else {?>
	<?php if ($error != ''): ?>
    <ul class="message error">
        <?php if ($error != ''): ?>
            <li><?php echo $error ?></li>
        <?php endif; ?>
    </ul>
<?php endif; ?>
<?php if($success != ''): ?>
<ul class="message success">
    <li><?php echo $success; ?></li>
</ul>
<?php endif; ?>
<form class="form has-validation" method="POST" action="">
    <input type="hidden" name="frmToken" id="frmToken" value="<?php echo $frmToken ?>"/>

    <div class="clearfix">
        <div class="clearfix"></div>
        <input type='text' name="content" class="content" id="content" value="<?php echo (set_value('content') != '') ?  set_value('content') : $postInfo['content'] ?>"></input>
    </div>

    <div class="form-action clearfix">
        <input class="button" type="submit" name="submit" data-icon-primary="ui-icon-circle-check" value="OK"/>
        <input class="button" type="reset" value="Nhập lại"/>
    </div>
</form>

<script type="text/javascript">
    $(document).ready(function() {
        
    });
</script>
<?php }?>